package com.example.trackcircuitdiagnosis.controller;

import com.example.trackcircuitdiagnosis.entity.DeviceInformationEntity;
import com.example.trackcircuitdiagnosis.entity.FaultTypeEntity;
import com.example.trackcircuitdiagnosis.service.FaultTypeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/fault")
public class FaultController {

    @Autowired
    FaultTypeService faultTypeService;

    @GetMapping("/{id}")
    @Operation(
            description = "查找故障信息",
            parameters = {
                    @Parameter(name = "id", description = "要查找设备故障id")
            }

    )
    public FaultTypeEntity findOne(@PathVariable Integer id) {
        return faultTypeService.getById(id);
    }
}
